/*
 * SupplierWS.java
 * 
 * Created: Aug 4, 2015
 * 
 * Copyright (c) ExpertPB 2015
 * All information contained herein is, and remains the property of
 * ExpertPB and its suppliers, if any.
 */
package com.emex.app.web;

import com.emex.app.shared.data.Repayment;
import com.emex.app.shared.data.Supplier;
import com.emex.app.shared.data.SupplierMoney;
import com.emex.app.shared.ws.SupplierWebService;
import com.emex.app.web.service.SupplierService;
import java.util.List;
import javax.ejb.Stateless;
import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

/**
 *
 * @author Sergey
 */
@WebService(serviceName = "SupplierWS", portName = "SupplierWSPort", targetNamespace = "http://emex.com/Supplier")
@Stateless(name = "SupplierWS")
public class SupplierWS extends SpringBeanAutowiringSupport implements SupplierWebService {

    @Autowired
    private SupplierService supplierService;

    @Override
    public int deleteSupplierByPrimaryKey(Integer id) {
        return supplierService.deleteSupplierByPrimaryKey(id);
    }

    @Override
    public Supplier insertSupplier(Supplier record) {
        return supplierService.insertSupplier(record);
    }

    @Override
    public List<Supplier> getAllSuppliers() {
        return supplierService.getAllSuppliers();
    }

    @Override
    public Supplier updateSupplier(Supplier record) {
        return supplierService.updateSupplier(record);
    }

    @Override
    public Supplier selectSupplierByPrimaryKey(Integer id) {
        return supplierService.selectSupplierByPrimaryKey(id);
    }

    @Override
    public int deleteSupplierMoney(Integer id) {
        return supplierService.deleteSupplierMoney(id);
    }

    @Override
    public SupplierMoney updateSupplierMoney(SupplierMoney record) {
        return supplierService.updateSupplierMoney(record);
    }

    @Override
    public SupplierMoney insertSupplierMoney(SupplierMoney record) {
        return supplierService.insertSupplierMoney(record);
    }

    @Override
    public List<SupplierMoney> getPaymentsFromClientBySupplierId(Integer id) {
        return supplierService.getPaymentsFromClientBySupplierId(id);
    }

    @Override
    public List<SupplierMoney> getPaymentsForSupplierBySupplierId(Integer id) {
        return supplierService.getPaymentsForSupplierBySupplierId(id);
    }

    @Override
    public List<SupplierMoney> getPaymentsByShopBySupplierId(Integer id) {
        return supplierService.getPaymentsByShopBySupplierId(id);
    }

    @Override
    public List<SupplierMoney> getReturnedPaymentsBySupplierId(Integer id) {
        return supplierService.getReturnedPaymentsBySupplierId(id);
    }

    @Override
    public int deleteRepayment(Integer id) {
        return supplierService.deleteRepayment(id);
    }

    @Override
    public Repayment insertRepayment(Repayment record) {
        return supplierService.insertRepayment(record);
    }

    @Override
    public Repayment updateRepayment(Repayment record) {
        return supplierService.updateRepayment(record);
    }

    @Override
    public List<Repayment> getRepaymetsForSupplier(Integer supplierId) {
        return supplierService.getRepaymetsForSupplier(supplierId);
    }   

}
